package com.lyc.controller;

import org.apache.solr.common.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

//有问题 403 跳不过来
@Controller
public class ErrorController {
    @RequestMapping("/error/unauthorized")
    public String error (HttpServletRequest request, Model model){
        String retUrl = request.getHeader("Referer");
        if (StringUtils.isEmpty(retUrl))
            retUrl = "/user/index";
        String content = "对不起，您暂无此权限！";
        model.addAttribute("url",retUrl);
        model.addAttribute("content",content);
        return "/";
    }
}
